Attach Subscriber Package

The Attach Subscriber Package API is used to attach a package to a subscriber. The system allows attaching a customer package (‘Sell Package’) to their sub-customers’ subscribers in a normal manner or attaching a package created by their parent customer (‘Buy Package’) to its own subscribers in a self-service manner. Using the self-service attach mode is permitted only if the parent customer has granted permission to this specific sub-customer by enabling the ‘allowOfferDelegation’ flag.

Method Path
POST api/v2/subscriber/{type}/{value}/package/{id}/attach

NOTE: All {type} and {value} pairs, define the search criteria. Valid {type} ENUMs are: ‘imsi’, ‘iccid’, ‘msisdn’, ‘imei’.

Eligibility

The Requestor is eligible to attach a package to his sub-customers’ subscribers. It is not allowed to attach a package to his own subscribers unless the requestor’s parent customer:

  • Has granted permission by turning on ‘allowOfferDelegation’ parameter.
  • Assigned at least one package to the requestor using the ‘eligibleSubAccountIds’ attribute when creating or modifying a package.

API Request

Request Structure

Parameter Type M/O/CM Description
myPackage Boolean O

Determines whether to attach one of the customer’s packages (Sell Package) to their sub-account subscribers or one of the customer’s parent packages (Buy Packages) to their own subscribers.

  • True = Request to attach a parent package (Buy Package) to their own subscribers. This ‘self-service’ functionality is allowed only in cases where the sub-customer has been defined by their parent customer as allowed to delegate parent customer packages (allow_offer_delegation = true).
  • False = Request to attach one of the customer’s packages (Sell Packages) to their sub-account subscribers (normal operation)

The default value, if not provided, is ‘false’

API Response

Response Structure

Parameter Type M/O/CM Description
errorCode String O Failure code. See list below, under ‘Error Codes’ section
errorMessage String O Failure detailed description. See list below, under ‘Error Codes’ section
content Object O Array of main response body object. Displayed when an API call was successful. For a failure, it will be empty.
pageable Object O Paging information object. Displayed when an API call was successful. For a failure, it will be empty.

Content

Parameter Type M/O/CM Description
requestId UUID M Request instance ID. To be used by external systems to query the call (operation) status, whether in progress, successful, or failed.
subscriberPackageId UUID M Package instance attached to the subscriber.

Pageable

Parameter Type M/O/CM Description
page Numeric M Page number
size Numeric M Page size. Number of requested elements per page
totalPages Numeric M Total amount of available pages per requested page size
totalElements Numeric M Total amount of retrieved elements

Error Code

In addition to the general success and failure codes, the following error codes are possible:

Code Message
GLOBAL_1001 Service unavailable. Please try again
SUBSCRIBER_1058 Failed to attach package
AUTH_1019 You are not allowed to attach parent customer package to your own SIM cards

Examples

Request Body

Copy
{
  "myPackage": false
}

Response Body Success ACK

Copy
{
  "errorCode": "",
  "errorMessage": "",
  "content": [
    {
      "requestId": "ff74dca6-8e7f-4b85-a42b-13860913b370",
      "subscriberPackageId": "eb74dfe6-8f7f-4b45-a42b-14460913b459"
    }
  ],
  "pageable": {
    "page": 0,
    "size": 10,
    "totalPages": 1,
    "totalElements": 1
  }
}

Response Body: Failure NAK

Copy
{
  "errorCode": "SUBSCRIBER_1058",
  "errorMessage": "Failed to attach package",
  "content": "",
  "pageable": null
}